#ifndef __CR_H__
#define __CR_H__

typedef struct{
	unsigned PE : 1; //Protection Enabled
	unsigned MP : 1; //Monitor Coprocessor
	unsigned EM : 1; //Emulation
	unsigned TS : 1; //Task Switched
	unsigned ET : 1; //Extension Type
	unsigned NE : 1; //Numeric Error
	unsigned Reserved1 : 10; //Reserved
	unsigned WP : 1; //Write Protect
	unsigned Reserved2 : 1; //Reserved
	unsigned AM : 1; //Alignment Mask
	unsigned Reserved3 : 10; //Reserved
	unsigned NW : 1; //Not Writethrough
	unsigned CD : 1; //Cache Disable
	unsigned PG : 1; //Paging
}CR0;

typedef unsigned CR2; //Page-Fault Virtual Address

typedef struct{
	unsigned Reserved1 : 3; //Reserved
	unsigned PWT : 1; //Page-Level Writethrough
	unsigned PCD : 1; //Page-Level Cache Disable
	unsigned Reserved2 : 12; //Reserved
	unsigned Base : 20; //Table Base Address Field
}CR3;

typedef struct{
	unsigned VME : 1; //Virtual-8086 Mode Extension
	unsigned PVI : 1; //Protected-Mode Virtual Interrupts
	unsigned TSD : 1; //Time Stamp Disable
	unsigned DE : 1; //Debugging Extension
	unsigned PSE : 1; //Page Size Extension
	unsigned PAE : 1; //Physical-Address Extension
	unsigned MCE : 1; //Machine Check Enable
	unsigned PGE : 1; //Page-Global Enable
	unsigned PCE : 1; //Performance-Monitoring Counter Enable
	unsigned OSFXSR : 1; //Operating System FXSAVE/FXRSTOR Support
	unsigned OSXMMEXCPT : 1; //Operating System Unmasked Exception
	unsigned Reserved1 : 8; //Reserved
	unsigned OSXSAVE : 1; //FXSAVE and Processor Extended States Enable Bit
	unsigned Reserved2 : 13; //Reserved
}CR4;

#endif
